import request from "@/utils/request";
//----------------------员工--------------------------
// 登录
export const login = (LoginRequest) => {
  return request.request({
    url: `/admin/emp/login`,
    method: "post",
    data:LoginRequest,
  });

};

//退出登录
export const logoutReuqest = () => {
  return request.request({
    url: `/admin/emp/logout`,
    method: "get",
  });
};

//分页查询员工
export const getEmployees = (RequestData) => {
  return request.request({
    url: `/admin/emp/getpages`,
    method: "post",
    data:RequestData,
  });
};


//查询单个员工
export const getEmployeeOne = (id) => {
  return request.request({
    url: `/admin/emp/getone/${id}`,
    method: "get",
  });
};

export const getEmployeeByDid = (id) => {
  return request.request({
    url: `/admin/emp/getebyd/${id}`,
    method: "get",
  });
};

//获取没有被分配就诊室的医生id和姓名
export const getEmployeeNotRoom = (id) => {
  return request.request({
    url: `/admin/emp/getNameId/${id}`,
    method: "get",
  });
};

//就诊室修改时使用
//获取没有被分配就诊室的医生id和姓名
export const getEmployeeNotRoom2 = (id,id2) => {
  return request.request({
    url: `/admin/emp/getNameId2/${id}/${id2}`,
    method: "get",
  });
};

//删除员工
export const deleteEmployeeById = (id) => {
  return request.request({
    url: `/admin/emp/delete/${id}`,
    method: "post",
  });
};

//添加员工
export const addEmployee = (RequestData) => {
  return request.request({
    url: `/admin/emp/add`,
    method: "post",
    data:RequestData
  });
};
//更新员工
export const updateEmployee = (RequestData) => {
  return request.request({
    url: `/admin/emp/update`,
    method: "post",
    data:RequestData
  });
};



//----------------------部门--------------------------
//分页获取部门
export const getDepartments = (RequestData) => {
  return request.request({
    url: `/admin/depart/getpages`,
    method: "post",
    data: RequestData,
  });
}

//查询单个部门
export const getDepartmentOne = (id) => {
  return request.request({
    url: `/admin/depart/getone/${id}`,
    method: "get",
  });
}

//查询部门的名称和id号
export const getDepartmentNameId = (id) => {
  return request.request({
    url: `/admin/depart/getNameId`,
    method: "get",
  });
}


//删除部门
export const deleteDepartments = (id) => {
  return request.request({
    url: `/admin/depart/delete/${id}`,
    method: "post",
  });
};




//修改
export const updateDepartments = (RequestData) => {
  return request.request({
    url: `/admin/depart/update`,
    method: "post",
    data: RequestData,
  });
}

// 添加
export const addDepartment = (RequestData) => {
  return request.request({
    url: `/admin/depart/add`,
    method: "post",
    data: RequestData,
  });
}